package com.neu.service.impl;

import com.neu.exception.BusinessException;
import com.neu.service.UserService;
import com.neu.vo.UserVO;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Override
    public UserVO findById(int id){

        if(id==1){
            throw new BusinessException("业务异常");
        }

        UserVO userVO = new UserVO();
        userVO.setId(id);
        userVO.setName(id%2==0?"张三":"李四");
        return userVO;
    }
}
